package domain;
// Generated 26-jun-2009 19:31:47 by Hibernate Tools 3.2.1.GA


import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Calls generated by hbm2java
 */
@Entity
@Table(name="calls"
    ,catalog="domeco"
)
public class Calls  implements java.io.Serializable {


     private Integer idCall;
     private Mobileconsumption mobileconsumption;
     private long mobile;
     private Date duration;
     private Date startCall;
     private String operador;
     private double cost;
     private Date dateCall;

    public Calls() {
    }

    public Calls(Mobileconsumption mobileconsumption, long mobile, Date duration, Date startCall, String operador, double cost, Date dateCall) {
       this.mobileconsumption = mobileconsumption;
       this.mobile = mobile;
       this.duration = duration;
       this.startCall = startCall;
       this.operador = operador;
       this.cost = cost;
       this.dateCall = dateCall;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idCall", unique=true, nullable=false)
    public Integer getIdCall() {
        return this.idCall;
    }
    
    public void setIdCall(Integer idCall) {
        this.idCall = idCall;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="mobileConsFK", nullable=false)
    public Mobileconsumption getMobileconsumption() {
        return this.mobileconsumption;
    }
    
    public void setMobileconsumption(Mobileconsumption mobileconsumption) {
        this.mobileconsumption = mobileconsumption;
    }
    
    @Column(name="mobile", nullable=false)
    public long getMobile() {
        return this.mobile;
    }
    
    public void setMobile(long mobile) {
        this.mobile = mobile;
    }
    @Temporal(TemporalType.TIME)
    @Column(name="duration", nullable=false, length=8)
    public Date getDuration() {
        return this.duration;
    }
    
    public void setDuration(Date duration) {
        this.duration = duration;
    }
    @Temporal(TemporalType.TIME)
    @Column(name="startCall", nullable=false, length=8)
    public Date getStartCall() {
        return this.startCall;
    }
    
    public void setStartCall(Date startCall) {
        this.startCall = startCall;
    }
    
    @Column(name="operador", nullable=false, length=100)
    public String getOperador() {
        return this.operador;
    }
    
    public void setOperador(String operador) {
        this.operador = operador;
    }
    
    @Column(name="cost", nullable=false, precision=22, scale=0)
    public double getCost() {
        return this.cost;
    }
    
    public void setCost(double cost) {
        this.cost = cost;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="dateCall", nullable=false, length=10)
    public Date getDateCall() {
        return this.dateCall;
    }
    
    public void setDateCall(Date dateCall) {
        this.dateCall = dateCall;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCall != null ? idCall.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Calls)) {
            return false;
        }
        Calls other = (Calls) object;
        if ((this.idCall == null && other.idCall != null) || (this.idCall != null && !this.idCall.equals(other.idCall))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "domain.Calls[idCall=" + idCall + "]";
    }






}


